<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../style/default/jsvm.css"/>
<link rel="stylesheet" type="text/css" href="../../style/default/dashboard.css"/>
<script id="j$vm" src="../../jsvm/jsre.js" ></script>
<script src="../../jsvm/lib/jsre-ui.js" ></script>
<script src="../../jsvm/src/js/util/Counter.js" ></script>
<script src="../../jsvm/src/js/awt/Spinner.js" ></script>
<style>



</style>
</head>
<body>


</body>


<script type="text/javascript">

J$VM.exec("Demo",function(System){

    this.prefer({theme: "default"});

    var spinner0 = new js.awt.Spinner(
        {
          x: 10, y: 10,
          id: "spinner0",
          lower: 1,
          upper: 100,
          index: 0,
          accel:{
              delay: 350,
              repeat:150,
              inc: 1
          },
          cyclic: true,
          resizable: true
        },this);
    this.addComponent(spinner0);
    spinner0.setRange(-10, 10);

    var label = new js.awt.Label(
        {x: 50,
         y: 10,
         css: "border:1px solid #999999;",
         width: 200,
         height: 17
        }, 
        this);
    label.spinnerHandler = function(e){
        var data  = e.getData();
        this.setText(data.count+":"+data.pos+"== "+spinner0.getValue());
    };
    J$VM.MQ.register("js.awt.event.SpinnerEvent", label, label.spinnerHandler);
    this.addComponent(label);

    spinner0.setPeerComponent(label);
});
</script>
</html>
